<template>
  <div class="qjzl">
    <div class="qjzlleft">
      <div class="lftitlebg true-flow">
        <span> </span>
      </div>
      <div class="lftopdiv lftitlebg">
        <ul>
          <li
            v-for="(item, index) in listtit"
            :key="index"
            :class="currentIndex == index ? 'isactive' : ''"
            @click="bgqihuan(index)"
          >
            {{ item.name }}
          </li>
        </ul>
        <keep-alive>
          <!-- <component :is="showWhat" :data="showWhat =='provincialdiqu'? listDq:listPg"></component> -->
          <provincialdiqu ref="dq" :data="listDq" v-if="showWhat"></provincialdiqu>
          <provincialpaiming  :data="listPg" v-if="!showWhat"></provincialpaiming>
        </keep-alive>
      </div>
    </div>
    <div class="qjzlcenter">
      <div class="width100per cenmap divclear">
        <div class="width100per dflex justifybetween positiondiv">
          <!-- 流出量展示 -->
          <div class="width500px positiondiv">
            <div class="width500px mapheightqjzl">
              <div
                id="myEchart"
                ref="myEchart"
                class="width500px mapheightqjzl"
              />
            </div>
            <div class="width100per divclear">
              <div class="bzdivbot">
                <div class="shuiqiutu">
                  <!-- <div class="sqtext">50.9%</div> -->
                </div>
                <div class="numbi">
                  <p style="padding-top: 5px">
                    <span class="liuchu">流出量</span>
                  </p>
                  <p class="num-bg">
                    <span class="bgnumcol">
                      <i v-for="(item) in listChNum.num" :key="item">{{item}}</i>
                    </span>
                    <span class="shuliang">万支</span>
                  </p>
                  <p style="line-height: 0">
                    <span class="tongbi"
                      >同比：<span class="baifenbi">{{listChNum.yearOnYear}}%</span>
                      <img src="../../assets/img/shang.png"
                    /></span>
                  </p>
                </div>
              </div>
            </div>
          </div>
          <!-- 地图  -->
          <div
            id="mapcenter"
            style="
              width: 100%;
              height: 550px;
              position: absolute;
              top: 0%;
              left: 0%;
            "
          ></div>
          <!-- 流出地区列表 -->
          <div class="partflex">
            <div class="parentright">
              <div class="shurig">
                <span
                  class="rigshui"
                  @click="showLiu = !showLiu"
                  style="cursor: pointer"
                >
                  流出省份<span>Top5</span>
                </span>
                <div class="listbg" v-if="showLiu">
                  <div class="zyflowul">
                    <ul>
                      <li v-for="(item, index) in outflow.list" :key="index">
                        <div
                          class="width100per dflex justifybetween fontsize14 whitecolor alignitem height36"
                        >
                          <div class="flagbg">
                            {{ index + 1 }}
                          </div>
                          <div class="yanwidth88">
                            {{ item.name }}
                          </div>
                          <div
                            class="fontsize14 lightblue"
                            style="margin-right: 50px; white-space: nowrap"
                          >
                            <count-to
                              :startVal="0"
                              :endVal="Number(item.num)"
                              :duration="3000"
                              :decimals="2"
                            ></count-to>
                            <span class="fontsize12 whitecolor marginleft2px"
                              >万支</span
                            >
                          </div>
                          <div class="fontsize14 lightblue">
                            <span class="fontsize12 whitecolor marginleft2px"
                              >{{ item.baif }}%</span
                            >
                          </div>
                        </div>
                      </li>
                    </ul>
                  </div>
                </div>
              </div>
              <div class="shurigxia">
                <span
                  class="rigshui"
                  @click="showALiu = !showALiu"
                  style="cursor: pointer"
                >
                  流出品规<span>Top5</span>
                </span>
                <div class="listbg" v-if="showALiu">
                  <div class="zyflowul">
                    <ul>
                      <li v-for="(item, index) in outflow.list2" :key="index">
                        <div
                          class="width100per dflex justifybetween fontsize14 whitecolor alignitem height36"
                        >
                          <div class="flagbg">
                            {{ index + 1 }}
                          </div>
                          <div class="yanwidth88">
                            {{ item.name }}
                          </div>
                          <div
                            class="fontsize14 lightblue"
                            style="margin-right: 10px"
                          >
                            <count-to
                              :startVal="0"
                              :endVal="Number(item.num)"
                              :duration="3000"
                              :decimals="2"
                            ></count-to>
                            <span class="fontsize12 whitecolor marginleft2px"
                              >万支</span
                            >
                          </div>
                          <div class="fontsize14 lightblue">
                            <span class="fontsize12 whitecolor marginleft2px"
                              >{{ item.baif }}%</span
                            >
                          </div>
                        </div>
                      </li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!--  -->
      <div class="width100per divclear">
        <div class="dflex width100per">
          <div class="maptableft1">
            <div class="centitlebg1">
              <span></span>
            </div>
          </div>
        </div>
      </div>
      <div class="centerbotdiv true-flow-bg">
        <div class="width100per dflexcolumn true-flow-table-title">
          <ul>
            <li
              v-for="(item, index) in listtitbot"
              :key="index"
              :class="currentIndex1 == index ? 'isactive1' : ''"
              @click="bgqihuan1(index)"
            >
              {{ item.name }}
            </li>
          </ul>
          <keep-alive>
            <!-- <component :is="showWhatecharts" :data="listWl"></component> -->
            <provinecharts  ref="provine" v-if="showWhatecharts"></provinecharts>
            <provincialbiqs  :data="listLxbqs"  v-if="!showWhatecharts"></provincialbiqs>
          </keep-alive>
        </div>
      </div>
    </div>
    <div class="qjzlright">
      <div class="dflex width100per justifybetween">
        <div class="centitlebg liuxiaobi-title"></div>
      </div>
      <div class="width100per divclear">
        <div class="rightyopa">
          <qingbaoyujing :data="listLxb"></qingbaoyujing>
        </div>
      </div>
    </div>
  </div>
</template>
  
<script>
import "./chinaMapOutline.js";
import "./china.js";
import chinaMap from "@/assets/json/china.json";
// import "../../mapdata/china/china.js";

import provincialdiqu from "./provincialdiqucopy.vue";
import provincialpaiming from "./provincialpaimingcopy.vue";

import provinecharts from "./provincialecharts";
import provincialbiqs from "./provincialbiqs";

import qingbaoyujing from "./qinbaocopy";
import { getOutflowGoodsNameRanking,
  getOutflowCityRanking,
  getOutflowSaleRadioRanking,
  getOutflowTotalNumTrend,
  getOutflowSaleRadioTrend,
  getOutflowTotalNumYearonyear,
  getOutflowOutProRank,
} from "@/api/inner.js";
//引入水球图插件
import "echarts-liquidfill";
export default {
  props: {
    picktimeTemp: {
      type: Object,
      required:true,
    },
  },
  watch: {
    picktimeTemp: {
      handler(newVal) {
        console.log('内管时间',newVal);
        this.init();
        this.initData();
        this.shuiqiutu();
        this.initMapInfo("mapcenter");
      },
      deep: true,
    },
  },
  data() {
    return {
      showLiu: false,
      showALiu: false,
      showWhat: "provincialdiqu",
      showWhatecharts: "provinecharts",
      listtit: [{ name: "地区排名" }, { name: "品规排名" }],
      listtitbot: [{ name: "外流总量趋势" }, { name: "流销比趋势" }],
      listPg:[],
      listDq:[],
      listLxb:[],
      listChNum:{
        num:[],
        yearOnYear:0
      },
      listWl:[],
      listLxbqs:[],
      currentIndex: 0,
      currentIndex1: 0,
      outflow: {
        list: [
          { name: "浙江省", addres: "", num: "564.04", baif: "+89.93" },
          { name: "江苏省", addres: "", num: "50.32", baif: "-61.68" },
          { name: "广东省", addres: "", num: "48.9", baif: "+42.32" },
          { name: "江西省", addres: "", num: "47.82", baif: "+196.65" },
          { name: "河北省", addres: "", num: "26.7", baif: "+2283.93" },
        ], //真烟流出品规
        list2: [
          { name: "红三环(渡江)", addres: "", num: "78.18", baif: "+191.72" },
          {
            name: "黄山(嘉宾迎客松)",
            addres: "",
            num: "55.58",
            baif: "+10.58",
          },
          { name: "黄山(新一品)", addres: "", num: "53.78", baif: "+25.77" },
          { name: "黄山(印象一品)", addres: "", num: "47.26", baif: "+191.37" },
          { name: "利群(新版)", addres: "", num: "46.38", baif: "+30.80" },
        ],
      },
      qsjydata: {
        list: [
          {
            unit: "合肥市",
            num: "102.94",
            sort: "A",
          },
          {
            unit: "安庆市",
            num: "101.52",
            sort: "A",
          },
          {
            unit: "六安市",
            num: "101.29",
            sort: "A",
          },
          {
            unit: "铜陵市",
            num: "93.71",
            sort: "A",
          },
          {
            unit: "池州市",
            num: "76.33",
            sort: "B",
          },
          {
            unit: "淮北市",
            num: "69.3",
            sort: "B",
          },
          {
            unit: "除州市",
            num: "68.65",
            sort: "B",
          },
          {
            unit: "马鞍山市",
            num: "67.71",
            sort: "B",
          },
          {
            unit: "芜湖市",
            num: "67.34",
            sort: "B",
          },
          {
            unit: "宣城市",
            num: "66.68",
            sort: "B",
          },
          {
            unit: "宿州市",
            num: "65.7",
            sort: "B",
          },
          {
            unit: "亳州市",
            num: "65.43",
            sort: "B",
          },
          {
            unit: "黄山市",
            num: "64.71",
            sort: "B",
          },
          {
            unit: "蚌埠市",
            num: "60.83",
            sort: "B",
          },
          {
            unit: "淮南市",
            num: "57.42",
            sort: "C",
          },
          {
            unit: "阜阳市",
            num: "57.02",
            sort: "C",
          },
        ],
      },
      maplist: {
        maplista: [
          {
            name: "市场秩序",
            color: "#C6FF83",
          },
          {
            name: "真烟异动",
            color: "#FFF583",
          },
          {
            name: "执法力度",
            color: "#83FBFF",
          },
          {
            name: "经营信心",
            color: "#FF83A3",
          },
        ],
        maplistb: [
          {
            name: "A：优≥80",
            color: "#00FF06",
          },
          {
            name: "B：80＞良≥60",
            color: "#007CEC",
          },
          {
            name: "C：差＜60",
            color: "#FF0000",
          },
        ],
      },
      anhuiarr: [
        {
          name: "蚌埠市",
          value: [117.003228, 33.099667],
        },
        {
          name: "合肥市",
          value: [116.953042, 31.86119],
        },
        {
          name: "芜湖市",
          value: [117.930051, 31.226319],
        },
        {
          name: "宣城市",
          value: [118.397995, 30.495667],
        },
        {
          name: "池州市",
          value: [117.139157, 30.296037],
        },
        {
          name: "亳州市",
          value: [116.002939, 33.550338],
        },
        {
          name: "铜陵市",
          value: [117.216576, 30.909935],
        },
        {
          name: "淮北市",
          value: [116.794664, 33.971707],
        },
        {
          name: "淮南市",
          value: [116.818329, 32.347574],
        },
        {
          name: "黄山市",
          value: [117.697325, 29.909239],
        },
        {
          name: "安庆市",
          value: [116.203551, 30.50883],
        },
        {
          name: "滁州市",
          value: [117.670264, 32.533627],
        },
        {
          name: "阜阳市",
          value: [115.250729, 32.956969],
        },
        {
          name: "宿州市",
          value: [117.134084, 33.783891],
        },
        {
          name: "马鞍山市",
          value: [118.507906, 31.569362],
        },
        {
          name: "六安市",
          value: [115.857676, 31.552889],
        },
      ],
      regionsdata: [
        {
          name: "蚌埠市",
          namea: "蚌埠",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "合肥市",
          namea: "合肥",
          littitle: "A",
          itemStyle: {
            color: "rgba(0, 255, 6, 1)", //省份背景色
          },
        },
        {
          name: "芜湖市",
          namea: "芜湖",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "宣城市",
          namea: "宣城",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "池州市",
          namea: "池州",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "亳州市",
          namea: "亳州",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "铜陵市",
          namea: "铜陵",
          littitle: "A",
          itemStyle: {
            color: "rgba(0, 255, 6, 1)", //省份背景色
          },
        },
        {
          name: "淮北市",
          namea: "淮北",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "淮南市",
          namea: "淮南",
          littitle: "C",
          itemStyle: {
            color: "rgba(255, 0, 0, 1)", //省份背景色
          },
        },
        {
          name: "黄山市",
          namea: "黄山",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "安庆市",
          namea: "安庆",
          littitle: "A",
          itemStyle: {
            color: "rgba(0, 255, 6, 1)", //省份背景色
          },
        },
        {
          name: "滁州市",
          namea: "滁州",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "阜阳市",
          namea: "阜阳",
          littitle: "C",
          itemStyle: {
            color: "rgba(255, 0, 0, 1)", //省份背景色
          },
        },
        {
          name: "宿州市",
          namea: "宿州",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "马鞍山市",
          namea: "马鞍山",
          littitle: "B",
          itemStyle: {
            color: "rgba(0, 124, 236, 1)", //省份背景色
          },
        },
        {
          name: "六安市",
          namea: "六安",
          littitle: "A",
          itemStyle: {
            color: "rgba(0, 255, 6, 1)", //省份背景色
          },
        },
      ],
      // geoJson:chinaMap
    };
  },
  components: {
    provincialdiqu,
    provincialpaiming,
    provinecharts,
    provincialbiqs,
    qingbaoyujing,
  },
  mounted() {
    // this.$echarts.registerMap("chinaMap", chinaMap);
    // this.rawLine({
    //   ename: Anhui,
    //   name: "安徽",
    // }); //初始地图
    this.init();
    this.initData();
    this.shuiqiutu();
    this.initMapInfo("mapcenter");
  },
  
  methods: {
    initData(){
      let that =this;
      let req1 =getOutflowGoodsNameRanking({...that.picktimeTemp,});
      let req2 =getOutflowCityRanking({...that.picktimeTemp,});
      let req3 =getOutflowSaleRadioRanking({...that.picktimeTemp,});
      let req4 =getOutflowTotalNumTrend({...that.picktimeTemp,});
      let req5 =getOutflowSaleRadioTrend({...that.picktimeTemp,});
      let req6 =getOutflowTotalNumYearonyear({...that.picktimeTemp,});
      let req7 = getOutflowOutProRank({...that.picktimeTemp,});
      Promise.all([req1,req2,req3,req4,req5,req6,req7])
      .then(function (results) {
        let data1 = results[0];
        console.log(data1,"真烟流出品规排名")
        that.listPg=data1.outflowGoodsNameRanking.data;
        that.outflow.list2.forEach((item,index)=>{
          item.name=data1.outflowGoodsNameRanking.data[index].brand_name;
          item.num=data1.outflowGoodsNameRanking.data[index].num;
          item.baif=data1.outflowGoodsNameRanking.data[index].yearOnYear;
        })
        let data2 = results[1];
        console.log(data2,"真烟流出地区排名")
        that.listDq=data2.outflowCityRanking.data;
        that.$refs.dq.initData(that.listDq);
        let data7 = results[6].outProviceRankData.data.slice(0,5);
        console.log(data7,'流出省份Top5');
         that.outflow.list.forEach((item,index)=>{
          item.name=data7[index].pro_name;
          item.num=data7[index].cigarNum;
          item.baif=data7[index].yearOnYear;
        })
        // that.outflow.list.forEach((item,index)=>{
        //   item.name=data2.outflowCityRanking.data[index].org_name;
        //   item.num=data2.outflowCityRanking.data[index].cigarNum;
        //   item.baif=data2.outflowCityRanking.data[index].yearOnYear;
        // })
        let data3 = results[2];
        console.log(data3,"真烟流销比地区排数据")
        that.listLxb=data3.outflowSaleRadioRanking.data;
        let data4 = results[3];
        console.log(data4,"真烟流销比地区排数据")
        that.listWl=data4.outflowTotalNumTrend.data;
        that.$refs.provine.init(that.listWl);
        let data5 = results[4];
        console.log(data5,"真烟外流流销比趋势分析数据")
        that.listLxbqs=data5.outflowSaleRadioTrend.data;
        let data6 = results[5];
        console.log(data6,"真烟流出总量（万支）及同比")
        that.listChNum.num=(data6.outflowTotalNumYearonyear.data[0].cigarNum+"").split('');
        that.listChNum.yearOnYear=data6.outflowTotalNumYearonyear.data[0].yearOnYear;
        console.log(that.listChNum,"真烟流出总量（万支）及同比")
      })
    },
    shuiqiutu() {},
    bgqihuan(index) {
      this.currentIndex = index;
      if (index == 0) {
        // 地区排名
        this.showWhat = true;
      } else {
        // 品规排名
        this.showWhat = false;
      }
     
    },
    bgqihuan1(index) {
      this.currentIndex1 = index;
      if (index == 0) {
        this.showWhatecharts = true;
      } else {
        this.showWhatecharts = false;
      }
      
    },
    init() {
      // let mychart = this.$echarts.init(document.getElementById("linezhe"));
      // let option = {
      //   grid: {
      //     top: '25%',
      //     left: '5%',
      //     right: '5%',
      //     bottom: '5%',
      //     containLabel: true,
      //   },
      //   tooltip: {
      //     trigger: 'axis',
      //     axisPointer: {
      //       type: 'line',
      //       lineStyle: {
      //         color: 'rgba(113, 113, 113, 1)',
      //       },
      //     },
      //     backgroundColor: 'rgba(42, 51, 74, 1)',
      //     borderColor: 'transparent',
      //     formatter: function (params) {
      //       let colors = ['rgba(124, 124, 191, 1)', 'rgba(233, 195, 116, 1)']
      //       let returnData = '<div style="padding: 5px 10px;">'
      //       returnData += '<span style="font-family: MicrosoftYaHei; font-size: 14px; color: rgba(210, 221, 249, 1);">' + params[0].axisValue + '</span><br/>'
      //       for (let i = 0; i < params.length; i++) {
      //         returnData += '<span style="display:inline-block; width:10px; height:8px; margin-right:5px; border-radius:1px; background-color:' + colors[i] + '"></span>'
      //         returnData += '<span style="font-family: MicrosoftYaHei; font-size: 14px; color: ' + colors[i] + '">' + params[i].seriesName + '：</span><span style="font-family: Verdana; font-size: 14px; color: ' + colors[i] + '">' + params[i].value + '</span><span style="display:inline-block; margin-left: 4px; line-height: 10px; font-family: MicrosoftYaHei; font-size: 12px; color: ' + colors[i] + '">车</span><br/>'
      //       }
      //       returnData += '</div>'
      //       return returnData
      //     }
      //   },
      //   xAxis: {
      //     type: 'category',
      //     axisLine: {
      //       lineStyle: {
      //         color: 'white'
      //       }
      //     },
      //     axisLabel: {
      //       // interval: 0,
      //       // rotate: 40,
      //       textStyle: {
      //         fontFamily: 'Microsoft YaHei'
      //       }
      //     },
      //     data: ['7-29', '7-30', '7-31', '8-1', '8-2', '8-3'],
      //   },
      //   yAxis: {
      //     type: 'value',
      //     name: '(万只)',
      //     axisLine: {
      //       show: false,
      //       lineStyle: {
      //         color: 'white'
      //       }
      //     },
      //     splitLine: {
      //       show: true,
      //       lineStyle: {
      //         color: 'rgba(255,255,255,0.3)'
      //       }
      //     },
      //     axisLabel: {}
      //   },
      //   series: [
      //     {
      //       name: '计划量',
      //       type: 'line',
      //       showAllSymbol: true,
      //       symbol: 'circle',
      //       symbolSize: 5,
      //       lineStyle: {
      //         color: 'rgba(155, 155, 226, 1)'
      //       },
      //       label: {
      //         show: false
      //       },
      //       itemStyle: {
      //         color: 'rgba(155, 155, 226, 0.8)',
      //         borderColor: 'rgba(155, 155, 226, 0.8)',
      //         borderWidth: 3
      //       },
      //       areaStyle: {
      //         normal: {
      //           color: new this.$echarts.graphic.LinearGradient(
      //             0,
      //             0,
      //             0,
      //             1,
      //             [
      //               {
      //                 offset: 0,
      //                 color: 'rgba(155, 155, 226, 0.8)',
      //               },
      //               {
      //                 offset: 1,
      //                 color: 'rgba(155, 155, 226, 0)',
      //               },
      //             ],
      //             false
      //           ),
      //           shadowColor: 'rgba(155, 155, 226, 0.8)',
      //           shadowBlur: 20,
      //         },
      //       },
      //       data: [502.84, 205.97, 332.79, 281.55, 398.35, 214.02],
      //     }
      //   ],
      // };
      // mychart.setOption(option)
    },
    rawLine(map) {
      //阴影区域
      let option = {
        // top:'-180px',
        // right:'-40px',
        series: [
          {
            type: "map3D",
            zoom: 2,

            // top:5%,
            selectedMode: "single", //地图高亮单选
            regionHeight: 23, //地图高度
            map: map.ename,
            viewControl: {
              center: [-10, 0, 0],
              distance: 175, //地图视角 控制初始大小
              autoRotate: false,
              rotateSensitivity: 0,
              alpha: 67, //视角绕 x 轴，即上下旋转的角度
              // rotateSensitivity: [1, 1],
              animation: true,
            },
            //  zoomSensitivity: false,//是否开启缩放和平移/鼠标滑动缩放禁止
            label: {
              show: true, //是否显示市
              textStyle: {
                color: "#fff", //文字颜色
                fontSize: 10, //文字大小
                backgroundColor: "rgba(0,0,0,0)",
              },
              formatter: function (param) {
                //  var str = param.data.littitle + "\n" + param.data.namea;
                var str = param.data.namea;
                // console.log(param)
                return str;
              },
            },
            itemStyle: {
              // areaColor: 'red',
              color: "#2B5890", //地图颜色
              borderWidth: 2, //分界线wdith
              borderColor: "#000", //分界线颜色
            },
            emphasis: {
              show: false,
              //   label: {
              //     show: true, //是否显示高亮
              //     textStyle: {
              //       color: "#fff", //高亮文字颜色
              //     },
              //   },
              //   itemStyle: {
              //     color: "#0489d6", //地图高亮颜色
              //   },
            },
            data: this.regionsdata,
          },
        ],
      };
      let myChart = this.$echarts.init(document.getElementById("myEchart"));
      myChart.showLoading();
      this.$echarts.registerMap(map.ename, map.ename);
      this.$nextTick(() => {
        // 初始化地图
        myChart.setOption(option, false);
        // myChart.resize();
        myChart.hideLoading();
      });
      //地图下钻点击事件
      myChart.on("click", (param) => {
        console.log(param);
        let names = param.name;
        // for (let key in this.dataList) {
        //   console.log(this.dataList[key]);
        //   if (names == this.dataList[key].name) {
        //     this.showArea(this.dataList[key], key);
        //     break;
        //   }
        // }
      });
    },
    showArea(param) {
      this.$echarts.registerMap(param.ename, param.ename);
      alert(param.name);
      this.rawLine(param); //重新绘画地图
    },
    //流入流出一个方法
    initMapInfo(id) {
      var that = this;
      // 地图数据
      var chinaGeoCoordMap = {
        黑龙江: [127.9688, 45.368],
        内蒙古: [110.3467, 41.4899],
        吉林: [125.8154, 44.2584],
        北京市: [116.4551, 40.2539],
        辽宁: [123.1238, 42.1216],
        河北: [114.4995, 38.1006],
        天津: [117.4219, 39.4189],
        山西: [112.3352, 37.9413],
        陕西: [109.1162, 34.2004],
        甘肃: [103.5901, 36.3043],
        宁夏: [106.3586, 38.1775],
        青海: [101.4038, 36.8207],
        新疆: [87.9236, 43.5883],
        西藏: [91.11, 29.97],
        四川: [103.9526, 30.7617],
        重庆: [108.384366, 30.439702],
        山东: [117.1582, 36.8701],
        河南: [113.4668, 34.6234],
        江苏: [118.8062, 31.9208],
        安徽: [117.29, 32.0581],
        湖北: [114.3896, 30.6628],
        浙江: [119.5313, 29.8773],
        福建: [119.4543, 25.9222],
        江西: [116.0046, 28.6633],
        湖南: [113.0823, 28.2568],
        贵州: [106.6992, 26.7682],
        云南: [102.9199, 25.4663],
        广东: [113.12244, 23.009505],
        广西: [108.479, 23.1152],
        海南: [110.3893, 19.8516],
        上海: [121.4648, 31.2891],
      };
      // 飞线点数据
      var chinaDatas = [
        [
          {
            name: "河北",
            value: 0,
          },
        ],
        [
          {
            name: "江苏",
            value: 0,
          },
        ],
        [
          {
            name: "浙江",
            value: 0,
          },
        ],
        [
          {
            name: "江西",
            value: 0,
          },
        ],
        [
          {
            name: "广东",
            value: 0,
          },
        ],
      ];
      let formdata = "安徽";

      var convertData = function (data) {
        var res = [];
        for (var i = 0; i < data.length; i++) {
          var dataItem = data[i];
          var fromCoord = chinaGeoCoordMap[dataItem[0].name];
          var toCoord = [117.29, 32.0581];

          // var toCoord = [108.384366, 30.439702]; //中心点地理坐标
          if (fromCoord && toCoord) {
            res.push([
              {
                // 飞线从哪里出发
                coord: toCoord,
              },
              {
                // 飞线去往哪里
                coord: fromCoord,
                value: dataItem[0].value,
              },
            ]);
          }
        }
        return res;
      };

      var series = [
        {
          type: "map",
          map: "chinaMapOutline",
          // 不响应鼠标交互
          silent: true,
          //调整以下3个配置项与页面地图重合
          // aspectScale: 0.75, // 地图的长宽比
          // center: [104.2, 35.9], //设置可见中心坐标，以此坐标来放大和缩小
          zoom: 0.75,
          left: "18%",
          top: "13%",
          itemStyle: {
            normal: {
              // 地图底色
              areaColor: "#056da2",
              // 高亮边缘+阴影样式
              borderWidth: 3,
              borderColor: "#41c7de",
              shadowBlur: 6,
              shadowColor: "#0d144a",
              shadowOffsetX: -3,
              shadowOffsetY: 4,
            },
          },
        },
        {
          type: "map",
          map: "china",
          zoom: 0.8,
          left: "20%",
          top: "16%",
          aspectScale: 0.75,
          label: {
            // 默认文本标签样式
            normal: {
              color: "white",
              show: false,
            },
            // 高亮文本标签样式
            emphasis: {
              show: false,
              // color: "yellow",
              // fontSize: 22,
              // fontWeight: "bold",
            },
          },
          itemStyle: {
            // 默认区域样式
            normal: {
              // 区域背景透明
              areaColor: "transparent",
              borderColor: "rgba(9, 5, 55)",
              borderWidth: 2,
            },
            // 高亮区域样式
            emphasis: {
              show: false,
              // 高亮区域背景色
              areaColor: "#01ADF2",
            },
          },
        },
      ];
      [[formdata, chinaDatas]].forEach(function (item, i) {
        series.push(
          {
            type: "lines",
            coordinateSystem: "geo",
            zlevel: 2,
            effect: {
              show: true,
              period: 4, //箭头指向速度，值越小速度越快
              trailLength: 0, //特效尾迹长度[0,1]值越大，尾迹越长重
              symbol: "arrow", //箭头图标
              symbolSize: 8, //图标大小
              color: "#2BC8FF", // 图标颜色
            },
            lineStyle: {
              normal: {
                show: true,
                width: 2, //尾迹线条宽度
                opacity: 1, //尾迹线条透明度
                curveness: 0.3, //尾迹线条曲直度
                color: "#2BC8FF", // 飞线颜色
              },
              color: "#2BC8FF",
            },
            data: convertData(item[1]),
          },
          {
            type: "effectScatter",
            coordinateSystem: "geo",
            zlevel: 2,
            rippleEffect: {
              //涟漪特效
              period: 4, //动画时间，值越小速度越快
              brushType: "stroke", //波纹绘制方式 stroke, fill
              scale: 4, //波纹圆环最大限制，值越大波纹越大
              color: "#2BC8FF",
            },
            label: {
              normal: {
                show: true,
                position: "right", //显示位置
                offset: [10, 0], //偏移设置
                formatter: function (params) {
                  //圆环显示文字
                  return params.data.name;
                },
                fontSize: 12,
              },
              emphasis: {
                show: false,
              },
            },
            symbol: "circle",
            symbolSize: function (val) {
              return 10; //圆环大小
            },
            itemStyle: {
              normal: {
                show: false,
                color: "#2BC8FF",
              },
            },
            data: item[1].map(function (dataItem) {
              return {
                //在这里定义你所要展示的数据
                // name: dataItem[0].name,
                // value: chinaGeoCoordMap[dataItem[0].name].concat([dataItem[0].value]),
                name: dataItem[0].name,
                value: chinaGeoCoordMap[dataItem[0].name].concat([
                  dataItem[0].value,
                ]),
              };
            }),
          },
          //中心点
          {
            type: "effectScatter",
            coordinateSystem: "geo",
            zlevel: 15,
            rippleEffect: {
              period: 4,
              brushType: "stroke",
              scale: 4,
              color: "#2BC8FF",
            },
            label: {
              normal: {
                show: true,
                position: "right",
                //offset:[5, 0],
                color: "#2BC8FF",
                formatter: "{b}",
                textStyle: {
                  color: "#2BC8FF",
                },
              },
              emphasis: {
                show: false,
                color: "#2BC8FF",
              },
            },
            symbol: "circle",
            symbolSize: 5,
            itemStyle: {
              color: "#2BC8FF",
            },
            data: [
              {
                name: item[0],
                value: chinaGeoCoordMap[item[0]].concat([10]),
              },
            ],
          }
        );
      });

      let myChart = this.$echarts.init(document.getElementById(id));

      let option = {
        // bgColor: '#1a1e45',

        // tooltip: {
        //   trigger: "item",
        // },

        geo: {
          map: "china",
          zoom: 0.8,
          left: "20%",
          top: "16%",
          roam: true,
          regions: [
            {
              name: "浙江",
              itemStyle: {
                areaColor: "red",
              },
            },
            {
              name: "江苏",
              itemStyle: {
                areaColor: "yellow",
              },
            },
            {
              name: "广东",
              itemStyle: {
                areaColor: "yellow",
              },
            },
            {
              name: "江西",
              itemStyle: {
                areaColor: "blue",
              },
            },
            {
              name: "河北",
              itemStyle: {
                areaColor: "blue",
              },
            },
          ],
          label: {
            normal: {
              show: false,
              textStyle: {
                color: "#FFFFFF",
              },
            },
            emphasis: {
              show: false,
            },
          },
          itemStyle: {
            normal: {
              areaColor: "#056da2",
              // {
              //   type: "linear-gradient",
              //   x: 0,
              //   y: 600,
              //   x2: 0,
              //   y2: 60,
              //   colorStops: [
              //     {
              //       offset: 0,
              //       color: "#003ecb", // 0% 处的颜色
              //     },
              //     {
              //       offset: 1,
              //       color: "#2bc8ff",
              //     },
              //   ],
              //   global: true, // 缺省为 false
              // },
              //地图背景色
              borderColor: "#080739", //省市边界线00fcff 516a89
              borderWidth: 1.5,
              textStyle: "#fff",
              shadowColor: "rgba(58,115,192,0.5)",
              shadowOffsetX: 5,
              shadowOffsetY: 5,
            },
            emphasis: {
              color: "#22ccfb", //悬浮背景
            },
          },
          data: [],
        },
        series: series,
      };
      myChart.showLoading();
      this.$nextTick(() => {
        // 初始化地图
        myChart.setOption(option, false);
        // myChart.resize();
        myChart.hideLoading();
      });
      //  myChart.setOption(option)
    },
  },
};
</script>
  
<style lang="scss" scoped>
@import "../../assets/scss/qjzl-neiguan.scss";

.mybox-leave-active,
.mybox-enter-active {
  transition: all 0s ease;
}

.mybox-leave-active,
.mybox-enter {
  height: 0px !important;
}

.mybox-leave,
.mybox-enter-active {
  height: auto;
}

.maptableft1 {
  width: 100%;
}

.centitlebg1 {
  width: 925px;
  height: 47px;
  background: url(../../assets/prov-inner-flow/zhenyanqushifenxi-title.png);
  line-height: 35px;
  background-size: 100% 100%;
  padding-left: 38px;
  color: #fff;
  padding-left: 38px;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 2px;

  .isactive1 {
    background: url(../../assets/img/btnov.png);
    background-size: 100% 100%;
  }

  span {
    float: left;
    width: 47%;
  }

  ul {
    font-size: 14px;
    float: right;
    width: 51%;
    margin-top: 10px;

    li {
      cursor: pointer;
      float: left;
      margin-left: 15px;
      background: url(../../assets/img/btnho.png);
      background-size: 100% 100%;
      font-size: 12px;
      width: 43%;
      height: 20px;
      text-align: center;
      line-height: 20px;
    }
  }
}

.true-flow-table-title {
  .isactive1 {
    background: url(../../assets/prov-inner-flow/tag-has-choose.png);
    background-size: 100% 100%;
  }

  ul {
    font-size: 14px;
    display: flex;
    width: 50%;
    margin: 8px auto 0;

    li {
      cursor: pointer;
      // float: left;
      // margin-left: 15px;
      background: url(../../assets/prov-inner-flow/tag-not-choose.png);
      background-size: 100% 100%;
      font-size: 12px;
      width: 50%;
      height: 30px;
      text-align: center;
      line-height: 30px;
    }
  }
}

.lftitlebg {
  .isactive {
    background: url(../../assets/prov-inner-flow/tag-has-choose.png);
    background-size: 100% 100%;
    color: #36acca;
  }

  span {
    float: left;
  }

  ul {
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    color: #6897b5;
    li {
      cursor: pointer;
      float: left;
      // margin-left: 15px;
      background: url(../../assets/prov-inner-flow/tag-not-choose.png);
      background-size: 100% 100%;
      font-size: 12px;
      width: 43%;
      height: 20px;
      text-align: center;
      line-height: 20px;
    }
  }
}

.lftopdiv,
.rightyopa {
  width: 100%;
  height: 813px;
  margin: 0 auto;
  background: url(../../assets/prov-inner-flow/liuxiaobi-bg.png);
  background-size: 100% 100%;
  padding: 10px 16px;
  // margin-top: -7px;
  position: relative;
  font-weight: 400 !important;
  &.qingbaoyujing {
    background: url(../../assets/prov-inner-flow/zhenyanqushifenxi-bg.png);
  }
  ul {
    list-style: none;

    li {
      width: 100%;
      height: 30px;
      line-height: 30px;
    }

    .jinduname {
      font-size: 14px;
    }

    .icon {
      width: 1.5%;
      height: 30%;
      font-size: 14px;
      background-size: 100% 100%;
      margin-top: 11px;
    }

    .baifen {
      width: 8%;
      margin-left: 10px;
      font-size: 14px;
    }
  }

  .titlist {
    float: left;
    width: 5%;
    height: 22px;
    text-align: center;
    line-height: 22px;
    font-size: 12px;
    margin-top: 5px;
    margin-right: 5px;
    padding-right: 1px;
  }

  span {
    float: left;
    width: 15%;
  }

  .el-progress {
    float: left;
    width: 60%;
    margin-top: 6px;
  }
}

.rightyopa::after {
  content: "";
  display: block;
  width: 100%;
  height: 15px;
  background: url(../../assets/qjzl/rightlinebot.png);
  background-size: 100% 100%;
  position: absolute;
  bottom: 0%;
  left: 0%;
}

.lftopdiv::after {
  content: "";
  display: block;
  width: 100%;
  height: 15px;
  // background: url(../../assets/qjzl/lftopdiv1bot.png);
  background-size: 100% 100%;
  position: absolute;
  bottom: 0%;
  left: 0%;
}

.centerbotdiv {
  // height: 218px
  width: 885px;
  height: 204px;
  background: url(../../assets/prov-inner-flow/zhenyanqushifenxi-bg.png);
}

.bzdivbot {
  position: absolute;
  top: -16px;
  left: 50%;
  font-weight: 600;
  .numbi {
    position: absolute;
    
    top: 28px;
    
    height: 60px;

    p {
      width: 100%;
      height: 40px;
      line-height: 40px;
      text-align: center;
      &.num-bg {
        width: 406px;
        height: 60px;
        background: url(../../assets/prov-inner-flow/flow-bg.png);
        background-size: 100% 100%;
        padding: 5px 0px 5px 20px;
      }
      img {
        height: 15px;
        width: 10px;
        margin-left: 5px;
        margin-top: 3px;
      }

      .tongbi {
        // float: right;
        font-size: 14px;
      }

      .bgnumcol {
        width: 303px;
        height: 44px;
        margin-right: 10px;
        font-size: 30px;
        color: #5ee3f9;
        font-weight: 600;
       // background: url(../../assets/prov-inner-flow/flow-data.png);
        i {
          display: inline-block;
          width: 30px;
          height: 46px;
          padding-right: 2px;
          text-align: center;
          font-style: normal;
        }
      }

      .baifenbi {
        color: #30fcfd;
        // float: right;
      }
    }
  }
}

.shuiqiutu {
  width: 380px;
  height: 140px;
  // background: url(../../assets/img/yuan.png);
  background-size: 100% 100%;
  position: relative;

  .sqtext {
    width: 256px;
    height: 60px;
    // background: url(../../assets/prov-inner-flow/flow-bg.png);
    background-size: 100% 100%;
    position: absolute;
    left: -2px;
    top: 0px;
    line-height: 120px;
    text-align: center;
    font-size: 21px;
  }
}

.parentright {
  position: relative;

  .shurig {
    position: absolute;
    right: -16px;
    top: 77px;
    width: 30px;
    height: 174px;
    background: url(../../assets/prov-inner-flow/open-top.png);
    background-size: 100% 100%;
    font-size: 14px;
    .rigshui {
      width: 5px;
      height: 100%;
      margin-top: 14px;
      margin-left: 8px;
      font-weight: 700;
      span {
        width: 5px;
        height: 30px;
        transform: rotate(90deg);
        -ms-transform: rotate(90deg);
        /* Internet Explorer 9*/
        -moz-transform: rotate(90deg);
        /* Firefox */
        -webkit-transform: rotate(90deg);
        /* Safari 和 Chrome */
        -o-transform: rotate(90deg);
        /* Opera */
      }
    }

    .listbg {
      width: 270px;
      height: 164px;
      position: absolute;
      top: -4px;
      left: -297px;
    }

    .zyflowul {
      position: absolute;
      left: 10%;
      top: 13px;
      width: 100%;
      height: 164px;
      background: url(../../assets/prov-inner-flow/open-data.png) no-repeat;
    }

    .zyflowul ul {
      width: 100%;
      margin: 0 auto;
      padding: 0 auto;
    }

    .zyflowul ul li {
      width: 100%;
      padding: 0px 11px;
      // line-height:36px;
      height: 33px;
    }

    .zyflowul ul li:nth-child(2n + 1) {
      // background: rgba(0, 52, 148, 0.3);
    }

    .zyflowul ul li div .flagbg {
      width: 30px;
      height: 18px;
      background: #c35f01;
      background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(1) div .flagbg {
      width: 30px;
      height: 18px;
      background: #ca465d;
      background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(2) div .flagbg {
      width: 30px;
      height: 18px;
      background: #d4ba32;
      background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(3) div .flagbg {
      width: 30px;
      height: 18px;
      background: #43c7de;
      background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(4) div .flagbg {
      width: 30px;
      height: 18px;
      background: #04c375;
      background-size: 100% 100%;
      text-align: center;
    }

    .yanwidth88 {
      width: 110px;
      margin: 0 auto;
      padding: 0 auto;
      overflow: hidden;
      text-overflow: ellipsis;
      display: inline-block;
      white-space: nowrap;
      margin-left: 5px;
    }

    .alignitem {
      align-items: center;
    }

    .justifybetween {
      justify-content: space-between;
    }

    .height36 {
      height: 36px;
    }
  }

  .shurigxia {
    position: absolute;
    right: -16px;
    top: 248px;
    width: 30px;
    height: 174px;
    background: url(../../assets/prov-inner-flow/open-bottom.png);
    background-size: 100% 100%;
    font-size: 14px;
    .listbg {
      width: 270px;
      height: 164px;
      position: absolute;
      top: -10px;
      left: -270px;
    }

    .rigshui {
      width: 5px;
      height: 100%;
      margin-top: 14px;
      margin-left: 8px;
      font-weight: 700;

      span {
        width: 5px;
        height: 30px;
        transform: rotate(90deg);
        -ms-transform: rotate(90deg);
        /* Internet Explorer 9*/
        -moz-transform: rotate(90deg);
        /* Firefox */
        -webkit-transform: rotate(90deg);
        /* Safari 和 Chrome */
        -o-transform: rotate(90deg);
        /* Opera */
      }
    }

    .zyflowul {
      position: absolute;
      left: 0%;
      top: 12px;
      width: 100%;
      height: 183px;
      background: rgba(41, 138, 255, 0.15);
    }

    .zyflowul ul {
      width: 100%;
      margin: 0 auto;
      padding: 0 auto;
      height: 164px;
      background: url(../../assets/prov-inner-flow/open-data.png) no-repeat;
    }

    .zyflowul ul li {
      width: 100%;
      padding: 0px 11px;
      // line-height:36px;
      height: 33px;
    }

    .zyflowul ul li:nth-child(2n + 1) {
      // background: rgba(0, 52, 148, 0.3);
    }

    .zyflowul ul li div .flagbg {
      width: 18px;
      height: 18px;
      // src\assets\img\Union@1x-47.png
      background: #c35f01;
      background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(1) div .flagbg {
      width: 18px;
      height: 18px;
      background: #ca465d;
      // background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(2) div .flagbg {
      width: 18px;
      height: 18px;
      background: #d4ba32;
      background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(3) div .flagbg {
      width: 18px;
      height: 18px;
      background: #43c7de;
      background-size: 100% 100%;
      text-align: center;
    }

    .zyflowul ul li:nth-child(4) div .flagbg {
      width: 18px;
      height: 18px;
      background: #04c375;
      background-size: 100% 100%;
      text-align: center;
    }

    .yanwidth88 {
      width: 90px;
      margin: 0 auto;
      padding: 0 auto;
      overflow: hidden;
      text-overflow: ellipsis;
      display: inline-block;
      white-space: nowrap;
      margin-left: 5px;
    }

    .alignitem {
      align-items: center;
    }

    .justifybetween {
      justify-content: space-between;
    }

    .height36 {
      height: 36px;
    }
  }
}

.echartsline {
  width: 100%;
}
</style>
<style lang="scss">
.el-progress-bar__inner {
  border-radius: 5px;
  background-color: unset;
  background-image: linear-gradient(to right, #6d9df8, #6dd6f8);
}

.el-progress-bar__outer {
  border-radius: 5px;
}
</style>
  